#pragma once
#include "WorldEntity.h"


#include <HAPI_lib.h>


class CEntityPlayer :public CWorldEntity
{
private:
	int startPositionX;
	int startPositionY;
	int state;
	int indexAnimationUp;
	int indexAnimationLeft;
	int indexAnimationRight;
	int timeBetweenProjectile;
	int timeCreationLastProjectile;
	int currentFrameAnimationUp;
	int currentFrameAnimationLeft;
	int currentFrameAnimationRight;
	int timeLastFrame;
	int totalHealth;
	int numberOfLife;
	int timeDisplayGameOver;
	int timeOfDeath;

	//variable for the animation when the player enter in the scene
	float beginTimeEntry;
	float endTimeEntry;
	int beginPositionEntryX;
	int beginPositionEntryY;

public:
	enum eStatePlayer
	{
		eFlyUp,
		eFlyLeft,
		eFlyRight,
		eFlyDown,
		eSpawn,
		eDead
	};
	CEntityPlayer(int startPositionX, int startPositionY, int health, int speed, int state, int collisionCost, bool active,
			int indexAnimationUp, int indexAnimationLeft, int indexAnimationRight, int speedAnimation );
	~CEntityPlayer(void);
	void CEntityPlayer::update(void);
	void CEntityPlayer::render(void);
	void CEntityPlayer::die(void);
	void CEntityPlayer::spawnPlayer(void);
	void CEntityPlayer::resetPlayer(void);
	bool CEntityPlayer::isDead(void);
	void CEntityPlayer::checkCollision(void);

	int CEntityPlayer::getStartPositionX(void) const;
	int CEntityPlayer::getStartPositionY(void) const;
	int CEntityPlayer::getState(void);
	int CEntityPlayer::getIndexAnimationUp(void)const;
	int CEntityPlayer::getIndexAnimationLeft(void)const;
	int CEntityPlayer::getIndexAnimationRight(void)const;
	int CEntityPlayer::getTimeBetweenProjectile(void)const;
	int CEntityPlayer::getTimeCreationLastProjectile(void)const;
	int CEntityPlayer::getCurrentFrameAnimationUp(void)const;
	int CEntityPlayer::getCurrentFrameAnimationLeft(void)const;
	int CEntityPlayer::getCurrentFrameAnimationRight(void)const;
	int CEntityPlayer::getTimeLastFrame(void)const;
	int CEntityPlayer::getTotalHealth(void);
	int CEntityPlayer::getNumberOfLife(void);

	void CEntityPlayer::setStartPositionX(int startPositionX);
	void CEntityPlayer::setStartPositionY(int startPositionY);
	void CEntityPlayer::setState(int state);
	void CEntityPlayer::setIndexAnimationUp(int indexAnimationUp);
	void CEntityPlayer::setIndexAnimationLeft(int indexAnimationLeft);
	void CEntityPlayer::setIndexAnimationRight(int indexAnimationRight);
	void CEntityPlayer::setTimeBetweenProjectile(int timeBetweenProjectile);
	void CEntityPlayer::setTimeCreationLastProjectile(int timeCreationLastProjectile);
	void CEntityPlayer::setCurrentFrameAnimationUp(int currentFrameAnimationUp);
	void CEntityPlayer::setCurrentFrameAnimationLeft(int currentFrameAnimationLeft);
	void CEntityPlayer::setCurrentFrameAnimationRight(int currentFrameAnimationRight);
	void CEntityPlayer::setTimeLastFrame(int timeLastFrame);
	void CEntityPlayer::setTotalHealth(int totalHealth);
	void CEntityPlayer::setNumberOfLife(int numberOfLife);
	
};
